package edu.kaifadui.lmbase.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {
    private int code;
    private T data;
    private String msg;
    private String token;
    private int total;
    /** 默认一页30条数据*/
    private int pageSize = 30;
    private int pageIndex;

    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result(int code, T data, String msg, String token) {
        this.code = code;
        this.data = data;
        this.msg = msg;
        this.token = token;
    }

    public Result(int code, T data, String msg, int total, int pageIndex) {
        this.code = code;
        this.data = data;
        this.msg = msg;
        this.total = total;
        this.pageIndex = pageIndex;
    }

    public Result(int code, T data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }
}
